<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="../include/tag.jsp" %>
<!DOCTYPE html>
<html lang="zh">
<head>
    <title>资讯分类</title>
    <link rel="stylesheet" href="${ctx}/css/common/list.css">
    <link rel="stylesheet" href="${ctx}/css/common/table.css">
    <%@include file="../include/commonFile.jsp" %>
</head>
<body>
<!--头部-->
<%@include file="../include/header.jsp" %>
<div class="index-outside">
    <%@include file="../include/sidebar.jsp" %>
    <!--内容-->
    <section>
        <div class="section-main">
            <div class="layui-tab layui-tab-brief">
                <div class="layui-tab-content">
                    <form class="layui-form" action="${ctx}/information/type/list.do" id="myForm" method="post">
                        <input type="hidden" name="pageNo" id="pageNo" value="${page.page}"/>
                        <div class="f-search-bar">
                            <div class="search-container">
                                <ul class="search-form-content">
                                    <li class="form-item-inline">
                                        <label class="search-form-lable">名称</label>
                                        <div class="layui-input-inline">
                                            <input type="text" name="name" autocomplete="off" class="layui-input"
                                                   value="${informationType.name}" placeholder="请输入查询类型名称">
                                        </div>
                                    </li>
                                    <li class="form-item-inline">
                                        <div class="sub-btns">
                                            <a class="layui-btn layui-btn-danger"
                                               href="javascript:submitFunction('#myForm')">查询</a>
                                            <a class="layui-btn layui-btn-normal"
                                               href="javascript:resetFunction('#myForm')">重置</a>
                                        </div>
                                    </li>
                                </ul>
                            </div>
                        </div>
                    </form>
                    <div class="my-act-list-content">
                        <ul id="view">
                            <table class="layui-table" lay-skin="line">
                                <colgroup>
                                    <col>
                                    <col>
                                    <col>
                                    <col>
                                </colgroup>
                                <thead>
                                <tr>
                                    <th>分类名称</th>
                                    <th>资讯数量</th>
                                    <th>排序</th>
                                    <th>创建时间</th>
                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                <c:forEach var="iType" items="${list}">
                                    <tr>
                                        <td>${iType.name}</td>
                                        <td><a href="${ctx}/information/list.do?informationTypeId=${iType.id}" class="red" target="_blank">${iType.informationNum}</a></td>
                                        <td>${iType.sort}</td>
                                        <td><fmt:formatDate value="${iType.createDate}" pattern="yyyy-MM-dd HH:mm"/></td>
                                        <td class="tb-opts">
                                            <div class="comm-opts">

                                                <a class="green"  href="${ctx}/information/type/informationTypeView.do?id=${iType.id}"><i class="iconfont icon-edit btn-icon"></i> 编辑</a>
                                                <a href="javascript:txz.deleteObject('确定要删除吗？', '${ctx}/information/type/delete.do?id=${iType.id}')" class="red" target="_self">删除</a>
                                            </div>
                                        </td>
                                    </tr>
                                </c:forEach>
                                </tbody>
                            </table>
                        </ul>
                    </div>
                    <div id="page_content" class="page-container"></div>
                </div>
            </div>
        </div><!--底部-->
        <%@include file="../include/footer.jsp" %>
    </section>
</div>

<%@include file="../include/incScript.jsp" %>
<script type="text/javascript" src="${ctx}/script/common/list.js"></script>
<script type="text/javascript" src="${ctx}/script/common/table_option.js"></script>
<script type="text/javascript">
    var element = null;
    $(function () {
        //加载分页
        loadPageNew({
            elem: 'page_content',
            totalCount: '${page.totalCount}',
            limit: '${page.limit}',
            page: '${page.page}'
        });
    })
</script>
<script type="text/javascript">
    txz.initHeader({
        nav: [{
            name: '资讯分类',
            curr: true
        }],
        info: '<span class="f12">共<b id="totalCount">${page.totalCount}</b>条记录</span>',
        btns: [{
            name: '新增分类',
            href: '${ctx}/information/type/informationTypeView.do',
            icon: 'add'
        }]
    });
</script>
</body>
</html>